<script src="/statics/js/layer.js"></script>
<!-- 头部开始 -->
<div class="header">
<!--    <div class="header_r"><img src="<?=session('loginImg')?>" width="30"></div>-->
    <div class="header_l"><a href="javascript:history.back(-1)"></a></div>
    <div class="header_m">申请退款</div>
</div>
<!-- 头部结束 -->

<!--订单详情开始-->
<div class="dingdan">
    <div class="dingdan-xx">订单编号：<?=I('get.orderId')?></div>
    
    <div class="dingdan-list">
        <div class="dingdan-list-zt"><i>商品信息</i></div>
        <?php if($collectData){$nums = 0;foreach($collectData AS $val){?>
        <ul>
            <li class="dingdan-list-li1"><a href="/goods/detail/id/<?=$val['goods_id']?>/sek/<?=mySpreadSek($val['cust_id'])?>"><img src="<?=transUrl($val['goods_pic'])?>" width="90%" height="90%"></a></li>
            <li class="dingdan-list-li2"><a href="/goods/detail/id/<?=$val['goods_id']?>/sek/<?=mySpreadSek($val['cust_id'])?>"><?=$val['goods_title']?><p>规格：<?=$val['goods_attr']?></p></a></li>
            <li class="dingdan-list-li3"><?=$val['pay_price']?>元<p>×<?=$val['pay_nums']?><?=$val['goods_attr']?></p></li>
        </ul>
        <?php $nums += $val['pay_nums'];}}?>
        <div class="dingdan-list-order"><span>合计：<i>¥<?=$orderData['order_amount']?></i> </span>共 <?=$nums?> 件商品</div>
    </div>
</div>
<form action="/order/refund" method="post" id="formid" enctype="multipart/form-data">
<div class="dingdan-liyou2">
	<?php $refunds = explode(',',getSysConfig('refundType'));?>
	<select name="type" id="rtype">
		<option value="">选择退款类型</option>
		<?php if($refunds){foreach($refunds AS $k=>$val){?>
        <option value="<?=$k+1?>"><?=$val?></option>
        <?php }}?>
    </select>
</div>
<div class="dingdan-tupian cd-popup-trigger2">图片上传</div>
<input type="hidden" value="1" name="dosubmit" />
<input type="hidden" value="<?=I('get.orderId')?>" name="orderId" />
<div class="dingdan-liyou"><textarea name="reason" id="reasons" placeholder="请输入退款理由"></textarea></div>
<div class="dingdan2-back"><a href="javascript:void(0)" id="putSubmit">提交申请</a></div>
<!--订单详情结束-->

<!--图片上传开始-->

<div class="cd-popup2" role="alert">
    <div class="cd-popup-container2">
        <div id="PopupLayer2" class="PopupLayer2"><a class="close cd-popup-close2"></a>
            <div class="xd-xzdz2"><span>图片1：</span><input class="dd-file" name="files[]" type="file"></div>
            <div class="xd-xzdz2"><span>图片2：</span><input class="dd-file" name="files[]" type="file"></div>
            <div class="xd-xzdz2"><span>图片3：</span><input class="dd-file" name="files[]" type="file"></div>
            <p class="canshu_n"><a href="#" class="cd-popup-close2">确定</a></p>
        </div>
    </div>
</div>
</form>
<!--订单详情结束-->

<div class="fiex nav"> <a class="icon-shouye fiex_on" href="/index/index/sek/<?=$sek?>"><br />
  首页</a> <a class="icon-fenlei" href="/cate/main/sek/<?=$sek?>"><br />
  分类</a> <a class="icon-gouwu" href="/cart/index/sek/<?=$sek?>"><br />
  购物车</a> <a class="icon-geren" href="/index/user/sek/<?=$sek?>"><br />
  用户中心</a> </div>
 <script>
 $(function(){
	 $('#putSubmit').click(function(){
		 if(!$('#rtype').val()){
			 layer.msg('退款类型必须选择', {icon: 0});
//		 }else if(!$('#reasons').val()){
//			 layer.msg('退款理由不能为空', {icon: 0});
		 }else if($('#rtype').val() != '3'){
             var upImg = false;
             $('.dd-file').each(function(){
                 if($(this).val()){
                     upImg = true;
                 }
             });
             if(upImg!=true){
                 layer.msg('请上传图片', {icon: 0});
                 return false;
             }
             $('#formid').submit();
         }else{
			 $('#formid').submit();
		 }
	 });
 });
 </script>